<?

require_once SITE_ROOT_PATH."/_lib/classes/class.tree.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.lurls.php";



class breadcrumb {



function get_html_breadcrumb($lineage){

	if(!empty($lineage)){
	
		$tree = new tree();
		$lineage = substr($lineage, 2);
		$breadcrumb = explode(',', $lineage);
		$lurls = new lurls();
		
		foreach($breadcrumb as $crumb_id){
		
			$params['tree_id'] = $crumb_id;
			$branch = $tree->get_branch($params);
                        
			$branch = $branch[0];
			
			// get the lurl of the destination
			$lurl = $lurls->get_branch_lurl($crumb_id);
			unset($params);
	
			$breadcrumb_html .= "<li>&rsaquo;</li><li title=\"".$branch['name']."\"><a href=\"".$lurl."\" title=\"".$branch['name']."\">".$branch['name']."</a></li>";
			
	
		}
		
	
		$breadcrumb_html = $start.$breadcrumb_html.$end;
		
		return $breadcrumb_html;
		
	}

}


}
